package com.power.bank.enums;

public enum ApplyStatus {
    CHECK_SUCCESS("CHECK_SUCCESS"), CHECK("CHECK"), CHECK_FAILED("CHECK_FAILED"), CREATE("CREATE"), CREATE_SUCCESS("CREATE_SUCCESS"), CREATE_FAILED("CREATE_FAILED"), FAILED("FAILED");

    private String value;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    ApplyStatus(String status) {
        value = status;
    }

    public  static ApplyStatus build(String status) {
        switch (status) {
            case "CHECK_SUCCESS":
                return CHECK_SUCCESS;
            case "CHECK":
                return CHECK;
            case "CHECK_FAILED":
                return CHECK_FAILED;
            case "CREATE":
                return CREATE;
            case "CREATE_SUCCESS":
                return CREATE_SUCCESS;
            case "CREATE_FAILED":
                return CREATE_FAILED;
            default:
                return FAILED;
        }
    }
}
